@extends('admin.layout.layout')

@section('content')
	
	@if(session('error'))
		<div class="alert alert-danger">
			{{ session('error') }}
		</div>
	@endif

	<div class="col-lg-6 col-lg-offset-3">
		<img id="preview" src="" width="300" height="200" style="display: none;" />

	    <form role="form" action="/admin/goods/insert" method="post" enctype="multipart/form-data">
	        <div class="form-group">
	            <label>商品图片上传</label>
	            <input type="file" name="goodspic" id="doc" multiple="multiple" style="width:150px;" onchange="javascript:setImagePreview();">
	        </div>
	        <div class="form-group">
	            <input type="file" name="pic2">
	        </div>
	            <input type="file" name="pic3">
	        <div class="form-group">
                <label>选择商品所属分类</label>
                <select class="form-control" name="cid">
                    <option>请选择</option>
					@foreach($goods as $v)
                    	<option value="{{$v->id}}">{{$v->catename}}</option>
					@endforeach
                </select>
            </div>
	        <div class="form-group">
	            <label>商品名称</label>
	            <input class="form-control" type="text" name="goodsname" placeholder="点击这里输入商品名称">
	        </div>
	        <div class="form-group">
	            <label>商品价格</label>
	            <input class="form-control" name="price" placeholder="点击这里输入商品价格" >
	        </div>
	        <div class="form-group">
	        </div>
	        <div class="form-group">
	            <label>商品颜色</label>
	            <input class="form-control" name="goodscolor" placeholder="点击这里输入商品颜色" >
	        </div>
	        <div class="form-group">
	            <label>商品大小</label>
	            <input class="form-control" name="goodssize" placeholder="点击这里输入商品大小" >
	        </div>
	        <div class="form-group">
	            <label>商品库存</label>
	            <input class="form-control" name="count" placeholder="点击这里输入商品库存" >
	        </div>
	        <br>
	        <div>
	        	<label>商品上架时间:<label>
	        	<label> &nbsp&nbsp&nbsp&nbsp&nbsp年 <label>
	        	<input type="text" size="5" name="year">
	        	<label> &nbsp&nbsp&nbsp&nbsp&nbsp月 <label>
	        	<input type="text" size="5" name="month">
	        	<label> &nbsp&nbsp&nbsp&nbsp&nbsp日 <label>
	        	<input type="text" size="5" name="day">
	        </div>
	        
	        <div class="form-group">
	            <label>商品介绍</label>
	            <textarea name="goodsinfo" class="form-control" rows="3" placeholder="点击输入商品信息"></textarea>
	        </div>
	        <input name="_token" type="hidden" value="{{csrf_token()}}">
	        <center>
	        	<button type="submit" class="btn btn-default">添加商品</button>
	        </center>
	    </form>
	</div>
	 <script type="text/javascript" src="/public/admin/js/setImagePreview.js"></script>
@endsection